new Vue({
    el: '#app',
    data() {
      return {
        form: {
        Data:'calendar_scheme_reward',
          page: 1,			//页数
          limit: 10			//每页数据条数
        },
        formData: {},
        tableData: [],		//表格数据
        total: 1,
      }
    },
    mounted() {
      this.getList(this.form)
    },
    methods: {
      handleSizeChange(val) {
        this.form.page = 1;
        this.form.limit = val;
        this.getList(this.form)
      },
      handleCurrentChange(val) {
        this.form.page = val;
        this.getList(this.form)
      },
      getList(data) {     //换页方法
        let _this = this
        $.ajax({
          type: 'POST',
          url: DomainName + "/getTableInquiryAction?token=" + $.cookie('token'),
          data,
          complete: function (XMLHttpRequest) {
            _this.loading = false
            if (XMLHttpRequest.getResponseHeader("REDIRECT") == "REDIRECT") {
              window.parent.document.location.href = "../../../" + XMLHttpRequest.getResponseHeader("CONTENTPATH");
            }
          },
          success: function (Result) {
            console.log(Result);
            _this.tableData = Result.tableData      //将获取的数据存到表格数据中
            _this.total = Number(Result.limit)
          },
          dataType: "json"
        });
      },
      onSerach(){

      },
      addEnterprise() {
        window.location.href = './Add.html'
      },
      editMember(Calendar_Scheme_Reward_SerialNumber) {
        sessionStorage.setItem("Calendar_Scheme_Reward_SerialNumber", Calendar_Scheme_Reward_SerialNumber)
        window.location.href = './Edit.html?Calendar_Scheme_Reward_SerialNumber=' + Calendar_Scheme_Reward_SerialNumber
      },
      deletMember(Brand_SerialNumber) {
        this.$confirm('此操作将删除该栏目, 是否继续?', '提示', {
          confirmButtonText: '确定',
          cancelButtonText: '取消',
          type: 'warning',
          center: true
        }).then(() => {
          this.delete(Brand_SerialNumber);
          this.getList(this.form);
          this.$message({
            type: 'success',
            message: '删除成功!'
          });
        }).catch(() => {
          this.$message({
            type: 'info',
            message: '已取消删除'
          });
        });
      },
      handleSelectionChange(val) {
        this.multipleSelection = val;
      },
    },
  })